package app.fugema.shop.main.login.view;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.base.common.utils.UIUtils;
import com.base.common.view.base.BaseFragment;
import com.base.common.viewmodel.BaseViewModel;
import app.fugema.shop.R;
import app.fugema.shop.databinding.FragmentCommonResultBinding;

import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;

public class CommonResultFragment extends BaseFragment<FragmentCommonResultBinding, BaseViewModel>
{

    public static CommonResultFragment newInstance() {
        Bundle args = new Bundle();
        CommonResultFragment fragment = new CommonResultFragment();
        fragment.setArguments(args);
        return fragment;
    }

    private String mResult="";

    public void setResult(String result)
    {
        this.mResult = result;
    }


    @Override
    protected FragmentCommonResultBinding initDataBinding(LayoutInflater inflater, ViewGroup container) {
        return DataBindingUtil.inflate(inflater, R.layout.fragment_common_result_, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
    {
        setResultTips();
    }


    public void setResultTips()
    {
        if(UIUtils.isNotEmpty( this.mResult ))
        {
            binding.tvResult.setText( this.mResult );
        }
    }
}
